import {
  Table,
  Column,
  Model,
  CreatedAt,
  UpdatedAt,
  HasOne,
} from 'sequelize-typescript';
import { Project } from 'src/project/project.entity';

@Table({
  tableName: 'audit',
})
export class Audit extends Model<Audit> {
  @Column({
    primaryKey: true,
  })
  id: number;

  @Column
  uuid: string;

  @Column
  state: number;

  @Column
  reason: string;

  @CreatedAt
  @Column({ field: 'created_at' })
  createdAt: Date;

  @UpdatedAt
  @Column({ field: 'updated_at' })
  updatedAt: Date;

  @HasOne(() => Project)
  project: Project;
}
